import java.util.Scanner;
public class Array02 {
    public static void main(String[] args) {
        //循环输入5个成绩，保持到double数组，并输出

        //1.创建数组
        double scores[] = new double[5];
        //or--double scores[];scores = new double[5];先声明数组，再 new 分配空间

        //2.循环输入
        Scanner myScanner = new Scanner(System.in);
        for (int i = 0;i < scores.length;i++) {
            System.out.println("请输入第"+(i+1)+"个元素的值");
            scores[i] = myScanner.nextDouble();
        }

        //3.输出，遍历数组
        System.out.println("===数组的元素值如下===");
        for (int i = 0;i < scores.length;i++){
            System.out.println("第"+(i+1)+"个元素的值="+scores[i]);
        }
    }

}